-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
temperature_driver: adds driver temperature sensor #6210
temperature_driver: adds driver temperature sensor #6210
Conversation
041bc62
to
94adeac
Compare
Would this allow for using the temperature to control a stepper driver fan? IMO this would be a nice use case instead unconditionally turning it on via |
Yes! 🙂 That was exactly my point with this, one can now have |
6805267
to
5b0beb8
Compare
klippy/extras/temperature_driver.py
Outdated
mcu = self.driver.get_mcu() | ||
measured_time = self.reactor.monotonic() | ||
self.temperature_callback( | ||
mcu.estimated_print_time(measured_time), | ||
self.temp) | ||
return measured_time + DRIVER_REPORT_TIME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a bunch of get_mcu()
methods so I could get the MCU on this level.
I'm not entirely sure of this whole block, so would really appreciatee if anyone could validate this is correct!
Thanks. As high-level feedback, I'm leery of introducing a "dummy temperature" to indicate "the temperature is not known". That is, I'm leery of using 0.0 when the driver temperature is not known. (In particular, when the dummy value itself could plausibly be valid.) I fear it could lead to confusion, weird looking graphs, and could propagate further downstream hacks to account for it. -Kevin |
Thanks Kevin, that's fair and makes complete sense. I guess the alternative is returning I will make the changes and test, and report back my findings. |
1e11f81
to
342df3f
Compare
Following up on the last comments, I've changed the code so that:
Code performs as expected and looking at all the places in Klipper where @Arksine on a separate but related note, I'm already working on a PR for Moonraker, specifically it would allow for |
I think the primary issue is that the TMC drivers don't consistently report temperature, thus they may not be a good candidate for a complete The challenge is determining the appropriate course of action when the driver is disabled. When the sensor is being relied upon by a peripheral this can introduce undesirable behavior, such as a continuously running fan. |
That's a very good point, and I honestly didn't consider that possibility... I admit I'm a bit out of ideas on how best to proceed on this PR, but @Arksine |
Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html There are some steps that you can take now:
Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available. Best regards, PS: I'm just an automated script, not a human being. |
342df3f
to
2d3de67
Compare
@pedrolamas Thanks! |
Hi @brotherdust, no this PR is just to expose the existing temperature read as a temperature sensor in Klipper, although it has some issues as reported above. Though out of scope for this PR, the estimation does sound very interesting! I'll keep an eye out for a contribution PR from you for it! |
@pedrolamas I think I will wait until the concerns raised above are addressed before submitting a PR (but will start working on it privately soon because I have some HOT steppers!) |
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2d3de67
to
3be315e
Compare
Unfortunately a reviewer has not assigned themselves to this GitHub Pull Request and it is therefore being closed. It is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available. Best regards, PS: I'm just an automated script, not a human being. |
I tried the configuration but I got the following error: Unknown temperature sensor 'temperature_driver' my config:
|
@eldeeb91 this PR has not been merged, so the functionality here described is NOT available. Having said that, #6292 was indeed merged, and together with changes that were also done in Moonraker, we have just released Fluidd 1.25 that shows the temperature of TMC2240 (screenshots here: fluidd-core/fluidd#1133) |
(This is a follow up on #6145 and discussion on PR #6205)
The following PR adds a new Temperature Sensor called
temperature_driver
that allows monitoring and reporting of the drivers temperature.Note: right now, only TMC2240 supports temperature reporting, but I've added no validation on the type of driver, so users will still be able to use any driver, however temperature reported will always be 0 for non-TMC2240!
With this change there is no change required either on Moonraker, Fluidd, Mainsail or any other UI, as it will be up to the user to add the temperature sensor.
Here's a sample config:
I took the above configuration and put it on a test system with a TMC2240 and this is the output in Fluidd (code changes only the ones on this Klipper PR and nothing more)
Signed-off-by: Pedro Lamas pedrolamas@gmail.com